Skip to content

Support dynamic workflow phases - #19

Merged
Michaelliv merged 6 commits into
Michaelliv:mainfrom
kky42:dynamic-workflow-phases
May 31, 2026
Merged

Support dynamic workflow phases#19
Michaelliv merged 6 commits into
Michaelliv:mainfrom
kky42:dynamic-workflow-phases

Conversation

@kky42

@kky42 kky42 commented May 31, 2026

Copy link
Copy Markdown
Contributor

Summary

This aligns the progress UI and tool guidance with what the workflow runtime already supports: phases can be created as the script runs.

  • Stop pre-rendering meta.phases; progress now follows phases that actually appear during execution.
  • Hide skipped/empty phase rows while keeping the active empty phase visible.
  • Keep snapshot.phases as the single runtime phase list; no extra parallel phase state is needed.
  • Update the tool guidance and README so meta.phases is clearly optional and conditional/loop-created phases are encouraged when useful.

Tests

  • npm test
  • Interactive Pi run with openai/gpt-5.5 and --thinking low, loading this extension explicitly. The workflow returned ok: true, included Initial scan, Inspect API, and Inspect UI, and left the skipped Review phase out of the result phases.

@kky42

kky42 commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

E2E verification supplement

I also ran a local interactive Pi smoke test against this branch. The fixture and session files were temporary local files on my machine only; they are not part of this PR and are not needed to review the change.

Setup:

  • Model: openai/gpt-5.5
  • Thinking: low
  • Loaded this extension explicitly from the checkout
  • Disabled ambient skills, extensions, prompt templates, themes, and context files
  • Disabled parent built-in tools so the parent agent had to use the workflow tool

Workflow shape used for the smoke test:

  • meta had only name and description; no meta.phases
  • Entered phase("Initial scan")
  • Had a skipped Review branch
  • Created Inspect API and Inspect UI phases from a loop
  • Ran 3 subagents against a tiny local facts.md fixture

The interactive UI rendered the dynamic phase list without an empty skipped phase row:

Workflow completed
◆ Workflow: verify_local_workflow (3/3 done)
  ✓ Initial scan 1/1
    #1 ✓ initial scan
  ✓ Inspect API 1/1
    #2 ✓ inspect api
  ✓ Inspect UI 1/1
    #3 ✓ inspect ui

The saved workflow details had the expected single phase list:

{
  "phases": ["Initial scan", "Inspect API", "Inspect UI"],
  "agentCount": 3,
  "doneCount": 3,
  "errorCount": 0
}

Additional checks:

  • The skipped Review branch did not render as Review 0/0
  • No dynamicPhases field was present in the details object
  • npm test passed with 17 tests

@Michaelliv
Michaelliv force-pushed the dynamic-workflow-phases branch from ad63f34 to 0a30057 Compare May 31, 2026 06:24
@Michaelliv
Michaelliv merged commit c914116 into Michaelliv:main May 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants